package com.job.Gai_Yian.Homework0707;

import com.sun.javafx.image.BytePixelSetter;

/**
 * @author Gai_Yian
 * @version 1.0
 * @since 2022-07-09 13:12:55
 */
public class MyHelper {
    public String name="张三";
    public int age=19;
    public String subject="计算机";

    public void ShowMyself(){
        MyHelper con=new MyHelper();
        System.out.println(con.name);
        System.out.println(con.age);
        System.out.println(con.subject);
    }

    public static double num(int[] arr) {
        int sum = 0;
        for (int n = 0; n <= arr.length - 1; n++) {
            sum += arr[n];
        }
        double aver = sum / arr.length;
        if (aver >= arr[arr.length / 2]) {
            return aver;
        } else {
            return arr[arr.length / 2];
        }
    }

}
